/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_mk_payment_to_main_kitchen")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findAll", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p"),
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findBySync", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findByPaymentId", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p WHERE p.paymentId = :paymentId"),
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findByPaymentDate", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p WHERE p.paymentDate = :paymentDate"),
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findByPaymentNumber", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p WHERE p.paymentNumber = :paymentNumber"),
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findByPaymentTotal", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p WHERE p.paymentTotal = :paymentTotal"),
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findByPaymentKeel", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p WHERE p.paymentKeel = :paymentKeel"),
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findByPaymentCash", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p WHERE p.paymentCash = :paymentCash"),
//    @NamedQuery(name = "PosTransactionMkPaymentToMainKitchen.findByPaymentTimestamp", query = "SELECT p FROM PosTransactionMkPaymentToMainKitchen p WHERE p.paymentTimestamp = :paymentTimestamp")})
public class PosTransactionMkPaymentToMainKitchen implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "payment_id")
    private Integer paymentId;
    @Column(name = "payment_date")
    @Temporal(TemporalType.DATE)
    private Date paymentDate;
    @Column(name = "payment_number")
    private String paymentNumber;
    @Column(name = "payment_total")
    private BigDecimal paymentTotal;
    @Column(name = "payment_keel")
    private String paymentKeel;
    @Column(name = "payment_cash")
    private BigDecimal paymentCash;
    @Column(name = "payment_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date paymentTimestamp;
    @Lob
    @Column(name = "payment_description")
    private String paymentDescription;
    
    @JoinColumn(name = "payment_regional_id", referencedColumnName = "regional_id")
    @ManyToOne(optional = false)
    private PosMasterRegional paymentRegionalId;
    @JoinColumn(name = "payment_receipt_id", referencedColumnName = "receipt_id")
    @ManyToOne(optional = false)
    private PosTransactionOutReceiptMaterialFromWarehouse paymentReceiptId;
    @JoinColumn(name = "payment_pos_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private PosMasterUnit paymentPosUnitId;
    @JoinColumn(name = "payment_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private MasterUnit paymentUnitId;
    @JoinColumn(name = "payment_user_id", referencedColumnName = "user_id")
    @ManyToOne(optional = false)
    private MasterUser paymentUserId;

    public PosTransactionMkPaymentToMainKitchen() {
    }

    public PosTransactionMkPaymentToMainKitchen(Integer paymentId) {
        this.paymentId = paymentId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Integer paymentId) {
        this.paymentId = paymentId;
    }

    public Date getPaymentDate() {
        return paymentDate;
    }

    public void setPaymentDate(Date paymentDate) {
        this.paymentDate = paymentDate;
    }

    public String getPaymentNumber() {
        return paymentNumber;
    }

    public void setPaymentNumber(String paymentNumber) {
        this.paymentNumber = paymentNumber;
    }
    
    public String getPaymentKeel() {
        return paymentKeel;
    }

    public void setPaymentKeel(String paymentKeel) {
        this.paymentKeel = paymentKeel;
    }

    public BigDecimal getPaymentTotal() {
        return paymentTotal;
    }

    public void setPaymentTotal(BigDecimal paymentTotal) {
        this.paymentTotal = paymentTotal;
    }

    public BigDecimal getPaymentCash() {
        return paymentCash;
    }

    public void setPaymentCash(BigDecimal paymentCash) {
        this.paymentCash = paymentCash;
    }

    public PosMasterRegional getPaymentRegionalId() {
        return paymentRegionalId;
    }

    public void setPaymentRegionalId(PosMasterRegional paymentRegionalId) {
        this.paymentRegionalId = paymentRegionalId;
    }

    public PosMasterUnit getPaymentPosUnitId() {
        return paymentPosUnitId;
    }

    public void setPaymentPosUnitId(PosMasterUnit paymentPosUnitId) {
        this.paymentPosUnitId = paymentPosUnitId;
    }

    public MasterUnit getPaymentUnitId() {
        return paymentUnitId;
    }

    public void setPaymentUnitId(MasterUnit paymentUnitId) {
        this.paymentUnitId = paymentUnitId;
    }

    public MasterUser getPaymentUserId() {
        return paymentUserId;
    }

    public void setPaymentUserId(MasterUser paymentUserId) {
        this.paymentUserId = paymentUserId;
    }
    
    public Date getPaymentTimestamp() {
        return paymentTimestamp;
    }

    public void setPaymentTimestamp(Date paymentTimestamp) {
        this.paymentTimestamp = paymentTimestamp;
    }

    public String getPaymentDescription() {
        return paymentDescription;
    }

    public void setPaymentDescription(String paymentDescription) {
        this.paymentDescription = paymentDescription;
    }

    public PosTransactionOutReceiptMaterialFromWarehouse getPaymentReceiptId() {
        return paymentReceiptId;
    }

    public void setPaymentReceiptId(PosTransactionOutReceiptMaterialFromWarehouse paymentReceiptId) {
        this.paymentReceiptId = paymentReceiptId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paymentId != null ? paymentId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionMkPaymentToMainKitchen)) {
            return false;
        }
        PosTransactionMkPaymentToMainKitchen other = (PosTransactionMkPaymentToMainKitchen) object;
        if ((this.paymentId == null && other.paymentId != null) || (this.paymentId != null && !this.paymentId.equals(other.paymentId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronsicecream.pos.entities.PosTransactionMkPaymentToMainKitchen[ paymentId=" + paymentId + " ]";
    }
    
}
